import request from "@/utils/request";

//获取规格列表
export function getItemSpecList() {
  return request({
    url: "/item_specs"
  });
}
// 添加规格
export function addItemSpec(data) {
  return request({
    url: "/item_specs",
    data: data,
    method: "post"
  });
}
//获取指定规格的属性列表
export function getSpecProps(specId, itemId) {
  return request({
    url: "/item_specs/" + specId + "/props",
    params: {
      item_id: itemId
    }
  });
}
//添加规格属性
export function addSpecProps(specId, props) {
  return request({
    url: "/item_specs/" + specId + "/props",
    data: props,
    method: "post"
  });
}

//更新规格的属性内容(更新图片)
export function updateSpecProp(data) {
  return request({
    url: "/spec_props/" + data.id,
    method: "put",
    data: data
  });
}
